package com.heima.feigns;

import com.heima.config.HeimaFeignAutoConfiguration;
import com.heima.feigns.fallback.AdminFeginFallback;
import com.heima.model.admin.pojos.AdChannel;
import com.heima.model.common.dtos.ResponseResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;

/**
 * @author lo
 * @date 2021/9/25
 */
@FeignClient(value = "leadnews-admin",
        fallbackFactory = AdminFeginFallback.class,
        configuration = HeimaFeignAutoConfiguration.class)
public interface AdminFegin {
    /**
     * 查询敏感词
     * @return
     */
    @PostMapping("/api/v1/sensitive/sensitives")
    ResponseResult sensitives();

    /**
     * 根据id查询频道信息
     * @param id 频道id
     * @return
     */
    @GetMapping("/api/v1/channel/one/{id}")
    ResponseResult<AdChannel> findOne(@PathVariable Integer id);

    /**
     * 获取频道列表
     * @return
     */
    @GetMapping("/api/v1/channel/channels")
    public ResponseResult getChannelList();

}
